﻿namespace MobileTrack.Core.Model
{
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data.Services.Common;

    [Table("Proveedores")]
    [EntityPropertyMapping("Nombre", SyndicationItemProperty.Title, SyndicationTextContentKind.Plaintext, true)]
    [EntityPropertyMapping("Direccion", SyndicationItemProperty.Summary, SyndicationTextContentKind.Plaintext, true)]
    public class Proveedor : BaseEntity
    {
        public Proveedor()
        {
            this.Abonos = new List<Abono>();
            this.Marcas = new List<Marca>();
        }

        [Required]
        [MaxLength(50)]
        public string Nombre { get; set; }

        [MaxLength(150)]
        public string Direccion { get; set; }

        [MaxLength(25)]
        [DataType(DataType.PhoneNumber)]
        public string Telefono { get; set; }

        public virtual ICollection<Abono> Abonos { get; set; }

        public virtual ICollection<Marca> Marcas { get; set; }
    }
}
